-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark ErrorCodes as serializable #15218
Conversation
When starting mypy daemon, we pickle options. Error codes are part of options and need to be pickle-able. This decorator is needed for this to be possible with mypyc.
for more information, see https://pre-commit.ci
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This PR seems to cause a new crash with custom plugins - only in compiled mode. I noticed it with pydantic. (Tested with Python 3.11) pydantic==1.10.7 # config.ini
plugins = pydantic.mypy # t.py
from pydantic import BaseModel
reveal_type(1) mypy --config-file=config.ini --show-traceback t.py Traceback
From what I can tell, the pydantic plugin always wants to emit an error (which isn't actually shown - this is probably an issue with the plugin itself) but when it calls ERROR_CONFIG = ErrorCode('pydantic-config', 'Invalid config value', 'Pydantic') |
This reverts commit 16b5922.
This reverts commit 16b5922.
This reverts commit 16b5922.
This reverts commit 16b5922.
This reverts commit 16b5922.
This reverts commit 16b5922.
This reverts commit 16b5922.
This reverts commit 16b5922.
This reverts commit 16b5922.
This reverts commit 16b5922.
This reverts commit 16b5922.
This reverts commit 16b5922.
This reverts commit 16b5922.
When starting mypy daemon, we pickle options. Error codes are part of options and need to be pickle-able. This decorator is needed for this to be possible with mypyc.
Fixes #14671